package com.example.k8s.hello.service.sys.config;

import com.example.k8s.hello.service.common.config.SaTokenConfig;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * 补充权限过滤名单
 */
@Component
public class SysSaTokenConfig implements ApplicationContextAware {

    /**
     * 修改SaTokenConfig的权限过滤的列表，此时SaTokenConfig已经构造完成但还没有注入
     * @param applicationContext the ApplicationContext object to be used by this object
     */
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) {
        SaTokenConfig.EXCLUDE.addAll(Arrays.asList("/sys/login","/sys/app-login", "/captcha.jpg"));
    }
}